# ref to mirror.txt and see golang for mirrored image
FROM golang:latest As builder

RUN apt-get update && apt-get install -y --no-install-recommands upx-ucl

WORKDIR /build

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 go build -ldflags='-w -s -extldflags "static"' -o sl cmd/Main.go && upx-ucl --best --ultra-brute sl

FROM scratch
COPY --from=builder /build/sl /bin/
WORKDIR /workdir
ENTRYPOINT ["/bin/sl"]
